<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Agentic AI Performance Dashboard</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: #f8f9fa;
            color: #333;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 1200px;
            margin: auto;
            background-color: #ffffff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        h1, h2 {
            color: #0056b3;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 10px;
        }
        .chart-container {
            position: relative;
            margin: 20px 0;
            height: 400px;
            width: 100%;
        }
        .summary {
            background-color: #e9ecef;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            font-size: 1.1em;
        }
        @media (max-width: 768px) {
            body { padding: 10px; }
            .container { padding: 15px; }
            .chart-container { height: 300px; }
        }
    </style>
</head>
<body>

    <div class="container">
        <h1>AI智能体表现数据看板</h1>
        
        <div class="summary">
            <p>实际处理数据总行数: <strong id="record-count">5000</strong></p>
        </div>

        <h2>Q1: 各智能体类型多模态能力占比Top 3</h2>
        <p>支持多模态处理（multimodal_capability）的智能体类型（agent_type）在该智能体类型中的占比，从大到小排名前三。</p>
        <div class="chart-container">
            <canvas id="q1Chart"></canvas>
        </div>

        <h2>Q2: 各大模型架构多模态能力占比Top 3</h2>
        <p>支持多模态处理（multimodal_capability）的大模型架构（model_architecture）在该大模型架构中的占比，从大到小排名前三。</p>
        <div class="chart-container">
            <canvas id="q2Chart"></canvas>
        </div>

        <h2>Q3: 各任务类型偏见检测中位数Top 3</h2>
        <p>各种智能体处理任务（task_category）各自的智能体表现的公正性（bias_detection_score）的中位数，从高到低排名前三。</p>
        <div class="chart-container">
            <canvas id="q3Chart"></canvas>
        </div>
    </div>

    <script>
        // 数据已经过预处理并内联到HTML中，以满足要求
        const q1Data = {
            labels: ['Code Assistant', 'Translation Agent', 'Content Creator'],
            values: [100.00, 100.00, 100.00] 
        };

        const q2Data = {
            labels: ['CodeT5+', 'GPT-4o', 'DALL-E-3'],
            values: [100.00, 100.00, 100.00]
        };

        const q3Data = {
            labels: ['Communication', 'Learning & Adaptation', 'Planning & Scheduling'],
            values: [0.82865, 0.8279, 0.8271]
        };

        function createBarChart(ctx, labels, data, label, unit = '%') {
            new Chart(ctx, {
                type: 'bar',
                data: {
                    labels: labels,
                    datasets: [{
                        label: label,
                        data: data,
                        backgroundColor: ['#7ab8f2', '#82c99f', '#f2c97a'],
                        borderColor: ['#0056b3', '#28a745', '#ffc107'],
                        borderWidth: 1
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    indexAxis: 'y',
                    scales: {
                        x: {
                            beginAtZero: true,
                            ticks: {
                                callback: function(value) {
                                    return value + unit;
                                }
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            display: false
                        }
                    }
                }
            });
        }

        document.addEventListener('DOMContentLoaded', () => {
            createBarChart(document.getElementById('q1Chart').getContext('2d'), q1Data.labels, q1Data.values, '多模态能力占比');
            createBarChart(document.getElementById('q2Chart').getContext('2d'), q2Data.labels, q2Data.values, '多模态能力占比');
            createBarChart(document.getElementById('q3Chart').getContext('2d'), q3Data.labels, q3Data.values, '偏见检测分数中位数', '');
        });
    </script>

</body>
</html>
